<?php 
require_once('../head/nav.php'); 
?>

    <div class="col-sm-9 col-md-10">
<?php 
if($data=='0'){
    echo "<h2>没有找到你想要的活动信息!</h2>";
  }else{
 ?>
<h1 class="text-center">社团活动信息表</h1>
    <table class="table table-hover"> 
    <!-- 通过添加 .table-hover 类可以让 <tbody> 中的每一行对鼠标悬停状态作出响应。 -->
      <tr class="success">
        <th>活动编号</th>
        <th>活动名称</th>   
        <th>承办部门</th>
        <th>活动意义</th>
        <th>时间</th>
        <th>地点</th>
        <th width='80'>活动照片展示</th>
      </tr>
    </div>
  </div>
</div>

<?php
  //var_dump($data);
  static $count=0;
  if(array_key_exists('acid',$data)){
    $count=1;
    $row = $data;
    //var_dump($row);
    echo '<tr>';
    echo '<td>'.$row['acid'].'</td>';
    echo '<td>'.$row['activity'].'</td>';
    echo '<td>'.$row['dename'].'</td>';  
    echo '<td>'.$row['signifi'].'</td>';
    echo '<td>'.$row['time'].'</td>';
    echo '<td>'.$row['place'].'</td>';  
    echo '<td align="center"><img src='.UserPhotoPath.$row['acphoto'].' width=120 height=100 alt="无头像"></td>';
    echo '</tr>';
  }else{
    foreach ($data as $row)
    {
      $count++;
      echo '<tr>';
      echo '<td>'.$row['acid'].'</td>';
      echo '<td>'.$row['activity'].'</td>';
      echo '<td>'.$row['dename'].'</td>';  
      echo '<td>'.$row['signifi'].'</td>';
      echo '<td>'.$row['time'].'</td>';
      echo '<td>'.$row['place'].'</td>';  
      echo '<td align="center"><img src='.UserPhotoPath.$row['acphoto'].' width=120 height=100 alt="无头像"></td>';
      echo '</tr>';
    }
  }
  echo '</table>';  
  echo "<table align='center'><tr><td>共有{$count}个活动</td></tr></table>";   
?>
<?php } ?>

</div> 
<?php require_once('../head/footer.php'); ?>